<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  
  <title>拼音加加配置备份和同步 | Wentao&#39;s Blog</title>

  
  <meta name="author" content="wentao">
  

  
  <meta name="description" content="拼音加加输入法
拼音加加是一个挺好的输入法,虽然作者一直不更新输入法,虽然在windows8上不能算是一个全功能的输入法.但是好用...
优点

对双拼的良好支持
辅助码不奇特,有些输入法的辅助码奇特的一塌糊涂.加加的辅助码基本没有重新记忆过.
使用的时间长,词库已经很符合自己的习惯了.
词库可以支">
  

  
  
  <meta name="keywords" content="AHK,Soft">
  

  <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">

  <meta property="og:title" content="拼音加加配置备份和同步"/>

  <meta property="og:site_name" content="Wentao&#39;s Blog"/>

  
  <meta property="og:image" content="/favicon.ico"/>
  

  <link href="/favicon.ico" rel="icon">
  <link rel="alternate" href="/atom.xml" title="Wentao&#39;s Blog" type="application/atom+xml">
  <link rel="stylesheet" href="/css/style.css" media="screen" type="text/css">
</head>


<body>
<div class="blog">
  <div class="content">

    <header>
  <div class="site-branding">
    <h1 class="site-title">
      <a href="/">Wentao&#39;s Blog</a>
    </h1>
    <p class="site-description"></p>
  </div>
  <nav class="site-navigation">
    <ul>
      
        <li><a href="/">主页</a></li>
      
        <li><a href="/archives">归档</a></li>
      
    </ul>
  </nav>
</header>

    <main class="site-main posts-loop">
    <article>

  
    
    <h3 class="article-title"><span>拼音加加配置备份和同步</span></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/2013/11/20/Jiajia-backup/" rel="bookmark">
        <time class="entry-date published" datetime="2013-11-20T12:05:01.000Z">
          2013-11-20
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <h3>拼音加加输入法</h3>
<p>拼音加加是一个挺好的输入法,虽然作者一直不更新输入法,虽然在windows8上不能算是一个全功能的输入法.但是好用...</p>
<h4>优点</h4>
<ul>
<li>对双拼的良好支持</li>
<li>辅助码不奇特,有些输入法的辅助码奇特的一塌糊涂.加加的辅助码基本没有重新记忆过.</li>
<li>使用的时间长,词库已经很符合自己的习惯了.</li>
<li>词库可以支持很大的,有几百万的词库可选.</li>
<li>神奇的命令直达</li>
</ul>
<h4>缺点</h4>
<ul>
<li>不能在多台机器间同步</li>
<li>不支持微软最新的输入法框架,导致在winodws8上面不能在<code>Metro</code>界面上使用.</li>
</ul>
<h3>加加同步的方案</h3>
<p>加加论坛上面有一个同步的解决办法.使用的是<code>批处理</code>的方式.但是那个分的太细了.自己也用不了那么多.平时就是需要把词库同步,整个输入法目录同步的机会估计很少.<code>bat</code>这东东自己也不熟悉.最后用了<code>AutoHotKey</code>做了一个替代的方案.</p>
<pre><code>:::ahk
EnvGet, syncDir, sync
EnvGet, softDir, soft
EnvGet, uprofile, userprofile
if syncDir =
    MsgBox,没有配置同步盘的环境变量.
if softDir =
    MsgBox,没有配置软件的环境变量

vtype =ciku
if 0 &gt;= 1
{
 vtype = %1%
}
if vtype = ciku
{
	
	FileCopyDir, %uprofile%\appdata\locallow\jjbxb, %syncDir%\Nuts\backup\jjbxb\save, 1
	FileRemoveDir, %syncDir%\Nuts\backup\jjbxb\save\tmp,1
	MsgBox,备份到网盘成功
}else if vtype = all
{
	FileCopyDir, %softDir%\jjbxb, %syncDir%\Nuts\backup\jjbxb, 1
	FileCopyDir, %uprofile%\appdata\locallow\jjbxb, %syncDir%\Nuts\backup\jjbxb\save, 1
	FileRemoveDir, %syncDir%\Nuts\backup\jjbxb\save\tmp,1
	MsgBox,全部备份成功
}
else if vtype = rall
{
	FileCopyDir, %syncDir%\Nuts\backup\jjbxb, %softDir%\jjbxb, 1
	FileCopyDir, %syncDir%\Nuts\backup\jjbxb\save, %uprofile%\appdata\locallow\jjbxb, 1
	MsgBox,全部恢复成功
}
else if vtype = rciku
{
	FileCopyDir, %syncDir%\Nuts\backup\jjbxb\save,%uprofile%\appdata\locallow\jjbxb 1
	MsgBox,从网盘恢复成功
}
</code></pre>
<p>其中用到了两个环境变量,<code>soft</code>是自己常用软件的存放位置.<code>sync</code>是同步网盘存放的位置.需要在环境变量里面提前设置一下.AHK的去参数的地方还是挺好玩的...</p>
<p><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">Scripts support command line parameters. The format is:</div><div class="line"></div><div class="line">AutoHotkey.exe [Switches] [Script Filename] [Script Parameters]</div><div class="line">And for compiled scripts, the format is:</div><div class="line"></div><div class="line">CompiledScript.exe [Switches] [Script Parameters]</div></pre></td></tr></table></figure></p>
<p>参数的信息使用数字获得,<code>0</code>表示参数的个数.从<code>1</code>开始代表参数的内容了.
<figure class="highlight autohotkey"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">if</span> <span class="number">0</span> &lt; <span class="number">3</span>  <span class="comment">; The left side of a non-expression if-statement is always the name of a variable.</span></div><div class="line">&#123;</div><div class="line">    MsgBox This script requires at least <span class="number">3</span> incoming parameters but it only received <span class="variable">%0%</span>.</div><div class="line">    ExitApp</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>ahk的语法还是真实很奇特.autoit这方面就好多了.</p>
<p>网盘使用了<a href="https://jianguoyun.com/%E2%80%8E" target="_blank" rel="external">坚果云</a>.原因就是增量同步,且客户端不想百度和腾讯那么搞的花里胡哨的.我就需要他静静的同步文件就可以了...</p>
<h4>配置加加</h4>
<p>在加加的自定义编码库中加入如下的信息
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line">;测试备份功能</div><div class="line">bfsj=/*$X[备份词库]</div><div class="line">.\sync.ahk</div><div class="line">ciku*/</div><div class="line">bfsj=/*$X[恢复词库]</div><div class="line">.\sync.ahk</div><div class="line">rciku*/</div><div class="line">bfsj=/*$X[备份整个加加]</div><div class="line">.\sync.ahk</div><div class="line">all*/</div><div class="line">bfsj=/*$X[恢复整个加加]</div><div class="line">.\sync.ahk</div><div class="line">rall*/</div></pre></td></tr></table></figure></p>
<h4>注意事项</h4>
<ul>
<li>ahk编译成exe以后,会被某些杀毒软件爆毒.请自觉加入到忽略列表.</li>
</ul>

      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/categories/Dev/">Dev</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/tags/AHK-Soft/">AHK,Soft</a>
    </span>
    

    </div>

    
  </div>
</article>

  
	<div id="comment">
	
	
	<!-- 多说评论框 start -->
	 <div class="ds-thread" data-thread-key="/2013/11/20/Jiajia-backup/" data-title="拼音加加配置备份和同步" data-url="http://wentao.org/2013/11/20/Jiajia-backup/"></div>
	<!-- 多说评论框 end -->
	<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
	<script type="text/javascript">
	var duoshuoQuery = {short_name:"wentao"};
	  (function() {
	    var ds = document.createElement('script');
	    ds.type = 'text/javascript';ds.async = true;
	    ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
	    ds.charset = 'UTF-8';
	    (document.getElementsByTagName('head')[0] 
	     || document.getElementsByTagName('body')[0]).appendChild(ds);
	  })();
	  </script>
	<!-- 多说公共JS代码 end -->
	
	</div>




    </main>

    <footer class="site-footer">
  <p class="site-info">
    Proudly powered by <a href="https://hexo.io/" target="_blank">Hexo</a> and
    Theme by <a href="https://github.com/CodeDaraW/Hacker" target="_blank">Hacker</a>
    </br>
    
    &copy; 2016 wentao
    
  </p>
</footer>
    
  </div>
</div>
</body>
</html>